<?php
namespace app\console\controllers;

use app\Services\api\SeatService;
use app\Services\api\UserCardService;
use yii\console\Controller;

class CrontabController extends Controller
{
    /**
     * 更新 Seat 表信息
     */
    public function actionUpdateSeat()
    {
        $res = SeatService::getInstance()->updateSeatByIndex();
         if($res['code'] == 200){
            echo "执行成功";
        }else{
            echo "执行失败";
        }
    }

    /**
     * 更新在线状态
     */
    public function actionOnlineState()
    {
        $res = SeatService::getInstance()->onlineState();
         if($res['code'] == 200){
            echo "执行成功";
        }else{
            echo "执行失败";
        }
    }
    /**
     * 重置邀请码
     */
    public function actionUpdateIvtCode()
    {
        $res = UserCardService::getInstance()->updateIvtCode();
        if ($res['code'] == 200) {
            echo "执行成功";
        } else {
            echo "执行失败";
        }
    }
}

?>